package org.kimoji.operate.service;

import org.kimoji.entity.Operate;
import org.kimoji.entity.biz.OperateBiz;
import org.kimoji.operate.OperateDAO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class OperateService {

	@Autowired
	private OperateDAO operateDAO;
	
	public boolean collect(String userId,Operate operate){
		String itemId = operate.getTargetId();
		
		return false;
	}
	
	public boolean attent(String userId,Operate operate){
		long iv = "accept".equals(operate.getAction())?1:-1;
		String albumId = operate.getTargetId();
		operateDAO.attent(userId, albumId, iv);
		return false;
	}
	
	public boolean support(String userId,Operate operate){
		long iv = "accept".equals(operate.getAction())?1:-1;
		String itemId = operate.getTargetId();
		operateDAO.support(userId, itemId, iv);
		return false;
	}
	
}
